<template>
  <!--    跑马灯-->
  <div style="overflow: hidden">
    <div class="line_box" v-if="!flag">
      <van-notice-bar left-icon="volume-o" mode="closeable" scrollable
        >石家庄:</van-notice-bar
      >
    </div>
    <div class="line_box" v-if="flag">
      <van-notice-bar left-icon="volume-o" mode="closeable" scrollable
        >石家庄:{{ list[0].date }}{{ list[0].weather }}{{ list[0].direct
        }}{{ list[0].temperature }}</van-notice-bar
      >
    </div>
  </div>
</template>

<script>
import { weather } from "../api/api";
export default {
  name: "RunHourse",
  data() {
    return {
      list: [],
      flag: true,
    };
  },
  created() {
    // // 获取天气接口请求
    weather(393).then((res) => {
    //   console.log(res);
      if (res.resultcode == 112) {
        this.list = [];
        this.flag = !this.flag;
      } else {
        this.list = res.result.future;
        this.flag = !this.flag;
      }
    });
  },
  methods: {},
};
</script>

<style scoped lang="less">
.line_box {
  margin-top: 64px;
}
/deep/.van-notice-bar {
  color: white;
  background-color: #79beff;
}
</style>